package app.server.project.main.service.service;

import app.server.project.core.constants.Def;
import app.server.project.core.exception.SysError;
import app.server.project.core.util.AssertUtil;
import app.server.project.main.service.db.entity.DeviceBaseEntity;
import app.server.project.main.service.dto.device.GenUUidReq;
import cn.hutool.core.util.IdUtil;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.ArrayList;
import java.util.List;

@Service
public class DeviceBaseService {

    /**
     * 生成id
     * @param model
     * @return
     */
    public String genDeviceId(GenUUidReq model){
        AssertUtil.isTrue(model.getNum()> Def.Zero, SysError.Sys);
        List<DeviceBaseEntity> list=new ArrayList<>();
        for (int i = 0; i < model.getNum(); i++) {
            list.add(DeviceBaseEntity.of(IdUtil.getSnowflakeNextId(), model.getDeviceTypeId()));
        }
        return "";
    }
}
